#!/bin/bash

set -e

base_dir="/home/caibh/gitee/ems-archive" 

# 引入封装的逻辑
source $base_dir/bin/common.sh

# 初始化
cm_init

# 加载配置文件
cm_load_properties "archive-iot-ts.properties"

while getopts :d:t:c:D: opt ; do
    case "$opt" in
        d) db=$OPTARG;;
        t) type=$OPTARG;;
        c) category=$OPTARG;;
        D) day=$OPTARG;;
        *) echo "ERR: 未知选项: $*" && exit 1;;
    esac
done

echo "db: $db"
echo "type: $type"
echo "category: $category"
echo "day: $day"

